home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / perl / stat.pl < prev    next >
Text File  |  1991-11-14  |  874b  |  41 lines

  1. ;# $Header: /sprite/src/cmds/perl/sprite/RCS/stat.pl,v 1.2 91/11/14 10:00:11 jhh Exp $
  2.  
  3. ;# Usage:
  4. ;#    require 'stat.pl';
  5. ;#    @ary = stat(foo);
  6. ;#    $st_dev = @ary[$ST_DEV];
  7. ;#
  8. $ST_DEV =    0 + $[;
  9. $ST_INO =    1 + $[;
  10. $ST_MODE =    2 + $[;
  11. $ST_NLINK =    3 + $[;
  12. $ST_UID =    4 + $[;
  13. $ST_GID =    5 + $[;
  14. $ST_RDEV =    6 + $[;
  15. $ST_SIZE =    7 + $[;
  16. $ST_ATIME =    8 + $[;
  17. $ST_MTIME =    9 + $[;
  18. $ST_CTIME =    10 + $[;
  19. $ST_BLKSIZE =    11 + $[;
  20. $ST_BLOCKS =    12 + $[;
  21. #
  22. # These are unique to Sprite.
  23. #
  24. $ST_SERVERID =        13 + $[;
  25. $ST_VERSION =        14 + $[;
  26. $ST_USERTYPE =        15 + $[;
  27. $ST_DEVSERVERID =    16 + $[;
  28.  
  29. ;# Usage:
  30. ;#    require 'stat.pl';
  31. ;#    do Stat('foo');        # sets st_* as a side effect
  32. ;#
  33. sub Stat {
  34.     ($st_dev,$st_ino,$st_mode,$st_nlink,$st_uid,$st_gid,$st_rdev,$st_size,
  35.     $st_atime,$st_mtime,$st_ctime,$st_blksize,$st_blocks,
  36.     $st_serverID, $st_version, $st_userType, $st_devServerID) = 
  37.     stat(shift(@_));
  38. }
  39.  
  40. 1;
  41.